import json

from selenium import webdriver


class DriverTools:

    __driver = None

    @classmethod
    def open_driver(cls):
        if cls.__driver is None:
            cls.__driver = webdriver.Chrome()
            cls.__driver.maximize_window()
        return cls.__driver

    @classmethod
    def quit_driver(cls):
        if cls.__driver is not None:
            cls.__driver.quit()
            cls.__driver = None

class ReadData():

    def read_data(self, file):
        with open(file, "r", encoding="utf-8") as f:
            jsonData = json.load(f)
            listData = []
            for x in jsonData:
                temp = tuple(x.values())
                listData.append(temp)
            return listData